<template>
  <div>
        <h1>login</h1>
        <el-button @click="handleSubmitBtnClick">登录按钮</el-button>
  </div>
</template>

<script>
import { mapGetters, mapActions } from 'vuex'
export default {
    data() {
        return {
            obj: {
                num: 1
            }
        }
    },
    computed: {
        ...mapGetters(['opt', 'token'])
    },
    mounted() {
        console.log(this.token, 'this.token')
    },
    methods: {
        ...mapActions('login', ['Login']),
        handleSubmitBtnClick() {
            this.Login().then(res => {
                this.$router.push('/hms/hospital')
            }).catch(err => {
                alert('err', err)
            })
        }
    }
}
</script>

<style>

</style>
